﻿using System.Windows.Forms;
using WinFormsMVC;

namespace SampleApp.Views.Main
{
    public partial class Welcome : ViewUserControl
    {
        public Welcome()
        {
            InitializeComponent();
        }

        private void SignInButton_Click(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(UserNameTextBox.Text))
            {
                MessageBox.Show("Username is required.");
                return;
            }

            if (string.IsNullOrEmpty(PasswordTextBox.Text))
            {
                MessageBox.Show("Password is required.");
                return;
            }

            App.Instance.CallRoute("Main", "Login", new
            {
                UserName = UserNameTextBox.Text,
                Password = PasswordTextBox.Text
            });
        }
    }
}
